home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
mail.altrad.com
/
2015.02.mail.altrad.com.tar
/
mail.altrad.com
/
TEST
/
office deutch
/
OUTLOOK.NL-NL
/
OUTLKLR.CAB
/
OUTLLIBR.DLL_1043
/
HTML
/
PAYCAL_HTML.XSL
< prev
next >
Wrap
Extensible Markup Language
|
2006-11-13
|
68KB
|
1,664 lines
<?xml version="1.0" encoding="UTF-8"?>
<!-- _LocalBinding -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:data="urn:data-section"
exclude-result-prefixes="data">
<!-- To figure out what some of the cryptic localization comments are, -->
<!-- see http://offglobe/LocalBinding/ -->
<xsl:output method="html" encoding="UTF-8"/>
<!-- **************************************************************************************************************
Some layout constants
*************************************************************************************************************** -->
<xsl:variable name="efbFree" select="0"/>
<xsl:variable name="efbTent" select="1"/>
<xsl:variable name="efbBusy" select="2"/>
<xsl:variable name="efbOof" select="3"/>
<xsl:variable name="efbOowh" select="9"/>
<!-- Keep this synced with CPayCalXSLTRenderer::FBSTATUS_OOWH in paycalinternal.h -->
<xsl:variable name="iMaxDatePick" select="6"/> <!-- Should be divisible by 2 -->
<xsl:variable name="iDatepickCellWidth" select="20"/>
<xsl:variable name="iDatepickTableWidth" select="$iDatepickCellWidth * 9"/>
<xsl:variable name="iFbWidth" select="12"/>
<xsl:variable name="iUpArrowWidth" select="17"/>
<xsl:variable name="iFbHeight" select="13"/>
<xsl:variable name="iOuterTableWidth" select="500"/>
<xsl:variable name="iOuterTablePadding" select="2"/>
<xsl:variable name="iScheduleHMarginOuter" select="20"/>
<xsl:variable name="iScheduleHMarginInner" select="10"/>
<xsl:variable name="iScheduleTimeWidth" select="150"/>
<xsl:variable name="iScheduleSubjectWidth" select="$iOuterTableWidth - $iScheduleHMarginOuter - $iScheduleHMarginInner - $iFbWidth - $iScheduleTimeWidth"/>
<xsl:variable name="iEventHMarginOuter" select="20"/>
<xsl:variable name="iOngoingHMarginOuter" select="20"/>
<xsl:variable name="iDetailHMarginLeft" select="17"/>
<xsl:variable name="iDetailNameWidth" select="90"/>
<xsl:variable name="iDetailHMarginInner" select="10"/>
<xsl:variable name="iDetailValueWidth" select="$iOuterTableWidth - $iDetailHMarginLeft - $iDetailNameWidth - $iDetailHMarginInner"/>
<xsl:variable name="iLineHeight" select="10"/>
<xsl:variable name="szFgColorScheduleOowh" select="'#666666'"/>
<xsl:variable name="szBgColorScheduleOowh" select="'#F7F7F7'"/>
<xsl:variable name="szFgColorScheduleAlldayOof" select="'#990099'"/>
<xsl:variable name="szBgColorScheduleAlldayOof" select="'#FFF7FF'"/>
<xsl:variable name="szFgColorScheduleAlldayBusy" select="'#000099'"/>
<xsl:variable name="szBgColorScheduleAlldayBusy" select="'#F7F7FF'"/>
<xsl:variable name="szFgColorScheduleDefault" select="'#000000'"/>
<xsl:variable name="szBgColorScheduleDefault" select="'#FFFFFF'"/>
<xsl:variable name="szRandomSeed" select="/dataroot/env-params/random-seed"/>
<xsl:variable name="fEventsLayout" select="/dataroot/user-params/email-layout = 'events'"/>
<xsl:variable name="rgndLocfmts" select="/dataroot/locfmts/locfmt"/>
<xsl:variable name="rgndDetailedAppts" select="/dataroot/appointments/appt[./has-details]"/>
<xsl:variable name="fHidingOowh" select="boolean(/dataroot/user-params/hiding-non-wkghrs)"/>
<xsl:variable name="fSuppressBold" select="boolean(/dataroot/env-params/suppress-bold)"/>
<xsl:variable name="fRtl" select="boolean(/dataroot/env-params/rtl-locale)"/>
<xsl:variable name="szLtrOrRtl">
<xsl:choose>
<xsl:when test="$fRtl">rtl</xsl:when>
<xsl:otherwise>ltr</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- O12:405933: setting dir=rtl doesn't reverse text alignment, so we need to do that manually -->
<xsl:variable name="szBidiAlignLeft">
<xsl:choose>
<xsl:when test="$fRtl">right</xsl:when>
<xsl:otherwise>left</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="szBidiAlignRight">
<xsl:choose>
<xsl:when test="$fRtl">left</xsl:when>
<xsl:otherwise>right</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="szAllDay">
Hele dag
</xsl:variable>
<!-- **************************************************************************************************************
<TABLE> Attribute Sets
*************************************************************************************************************** -->
<xsl:attribute-set name="table-base">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
<!--<xsl:attribute name="bordercolor">red</xsl:attribute>-->
<xsl:attribute name="cellpadding">0</xsl:attribute>
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="style">border-collapse:collapse;border:none</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table-outer" use-attribute-sets="table-base">
<xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table-outer-padded" use-attribute-sets="table-outer">
<xsl:attribute name="cellpadding"><xsl:value-of select="$iOuterTablePadding"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table-datepick" use-attribute-sets="table-base">
<xsl:attribute name="width"><xsl:value-of select="$iDatepickTableWidth"/></xsl:attribute>
</xsl:attribute-set>
<!-- **************************************************************************************************************
<TD> Attribute Sets
*************************************************************************************************************** -->
<xsl:attribute-set name="td-base-datepick">
<xsl:attribute name="width"><xsl:value-of select="$iDatepickCellWidth"/></xsl:attribute>
<xsl:attribute name="align">center</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-datepick-dow" use-attribute-sets="td-base-datepick"/>
<xsl:attribute-set name="td-datepick-date-in" use-attribute-sets="td-base-datepick"/>
<xsl:attribute-set name="td-datepick-date-out" use-attribute-sets="td-base-datepick"/>
<xsl:attribute-set name="td-datepick-date-hmargin" use-attribute-sets="td-base-datepick"/>
<xsl:attribute-set name="td-base-sectionbar">
<xsl:attribute name="bgcolor">#A5ADC5</xsl:attribute>
<xsl:attribute name="height">30</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-schedule-month" use-attribute-sets="td-base-sectionbar"/>
<xsl:attribute-set name="td-events-year" use-attribute-sets="td-base-sectionbar"/>
<xsl:attribute-set name="td-ongoing-head" use-attribute-sets="td-base-sectionbar"/>
<xsl:attribute-set name="td-details-head" use-attribute-sets="td-base-sectionbar"/>
<xsl:attribute-set name="td-events-subject">
<xsl:attribute name="align"><xsl:value-of select="$szBidiAlignLeft"/></xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-events-time">
<xsl:attribute name="align"><xsl:value-of select="$szBidiAlignRight"/></xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-ongoing-subject">
<xsl:attribute name="align"><xsl:value-of select="$szBidiAlignLeft"/></xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-ongoing-recurrence">
<xsl:attribute name="align"><xsl:value-of select="$szBidiAlignRight"/></xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-details-leftmargin">
<xsl:attribute name="width"><xsl:value-of select="$iDetailHMarginLeft"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-details-name">
<xsl:attribute name="width"><xsl:value-of select="$iDetailNameWidth"/></xsl:attribute>
<xsl:attribute name="align"><xsl:value-of select="$szBidiAlignRight"/></xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-details-innermargin">
<xsl:attribute name="width"><xsl:value-of select="$iDetailHMarginInner"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-details-value">
<xsl:attribute name="width"><xsl:value-of select="$iDetailValueWidth"/></xsl:attribute>
<xsl:attribute name="align"><xsl:value-of select="$szBidiAlignLeft"/></xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="td-details-value-noalign">
<xsl:attribute name="width"><xsl:value-of select="$iDetailValueWidth"/></xsl:attribute>
<xsl:attribute name="valign">top</xsl:attribute>
</xsl:attribute-set>
<!-- **************************************************************************************************************
<IMG> Attribute Sets
*************************************************************************************************************** -->
<xsl:attribute-set name="img-uparrow">
<xsl:attribute name="src">cid:paycal_uparrow.gif</xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$iUpArrowWidth"/></xsl:attribute>
<xsl:attribute name="height">17</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="img-line-outer-thin">
<xsl:attribute name="src">cid:paycal_line_outer_thin.gif</xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="img-line-outer-thick">
<xsl:attribute name="src">cid:paycal_line_outer_thick.gif</xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="img-line-datepick">
<xsl:attribute name="src">cid:paycal_line_datepick.gif</xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$iDatepickTableWidth"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="img-line-datepick-ellipsis">
<xsl:attribute name="src">cid:paycal_line_datepick_ellipsis.gif</xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="img-line-event-separator">
<xsl:attribute name="src">cid:paycal_line_event_separator.gif</xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</xsl:attribute-set>
<!-- **************************************************************************************************************
<FONT> Attribute Sets
*************************************************************************************************************** -->
<xsl:attribute-set name="font-base">
<xsl:attribute name="size">-1</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-base-blue" use-attribute-sets="font-base">
<xsl:attribute name="color">#31527B</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-base-gray" use-attribute-sets="font-base">
<xsl:attribute name="color">#999999</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-base-white" use-attribute-sets="font-base">
<xsl:attribute name="color">#FFFFFF</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-user-message" use-attribute-sets="font-base">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-head" use-attribute-sets="font-base-blue">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-legend" use-attribute-sets="font-base-blue">
<xsl:attribute name="size">-1</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-datepick-month" use-attribute-sets="font-base-blue">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-datepick-dow" use-attribute-sets="font-base-blue"/>
<xsl:attribute-set name="font-datepick-date-out" use-attribute-sets="font-base-gray"/>
<xsl:attribute-set name="font-datepick-date-in-nolink" use-attribute-sets="font-base-gray"/>
<xsl:attribute-set name="font-datepick-date-in-link" use-attribute-sets="font-base-blue"/>
<xsl:attribute-set name="font-schedule-month" use-attribute-sets="font-base-white">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-schedule-day" use-attribute-sets="font-base-blue">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-schedule-text" use-attribute-sets="font-base"/>
<xsl:attribute-set name="font-events-year" use-attribute-sets="font-base-white">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-events-text" use-attribute-sets="font-base"/>
<xsl:attribute-set name="font-events-disabled" use-attribute-sets="font-base-gray"/>
<xsl:attribute-set name="font-ongoing-head" use-attribute-sets="font-base-white">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-ongoing-text" use-attribute-sets="font-base"/>
<xsl:attribute-set name="font-details-head" use-attribute-sets="font-base-white">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-details-day" use-attribute-sets="font-base-blue">
<xsl:attribute name="size">+0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="font-details-text" use-attribute-sets="font-base"/>
<!-- **************************************************************************************************************
main()
*************************************************************************************************************** -->
<xsl:template match="/">
<html dir="{$szLtrOrRtl}"><head><title>Title Irrelevant (Do not localize)</title></head>
<body bgcolor="#FFFFFF" link="#31527B" vlink="#31527B" alink="#31527B">
<xsl:variable name="ndHtmlBody">
<font xsl:use-attribute-sets="font-user-message"><br/><br/><br/></font>
<xsl:call-template name="WriteSectionHead"/>
<xsl:call-template name="WriteSectionDatepick"/>
<xsl:choose>
<xsl:when test="$fEventsLayout">
<xsl:call-template name="WriteSectionEvents"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="WriteSectionLegend"/>
<xsl:call-template name="WriteSectionSchedule"/>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="WriteSectionOngoingAppts"/>
<xsl:call-template name="WriteSectionDetails"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$fSuppressBold">
<xsl:call-template name="WriteUnboldedHtml">
<xsl:with-param name="ndBody" select="$ndHtmlBody"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$ndHtmlBody"/>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
</xsl:template>
<!-- **************************************************************************************************************
WriteSectionHead()
*************************************************************************************************************** -->
<xsl:template name="WriteSectionHead">
<xsl:variable name="rgndDays" select="/dataroot/calendar/year/month/week/day"/>
<xsl:variable name="absStart" select="$rgndDays[position() = 1]/@abs"/>
<xsl:variable name="absEnd" select="$rgndDays[position() = count($rgndDays)]/@abs"/>
<center><a name="top{$szRandomSeed}"><img xsl:use-attribute-sets="img-line-outer-thick"/></a></center>
<table xsl:use-attribute-sets="table-outer">
<tr>
<td> </td>
<td><font xsl:use-attribute-sets="font-head">
<b><xsl:value-of select="/dataroot/user-params/calendar-name"/></b>
<xsl:if test="/dataroot/user-params/owner-email">
<br/><xsl:value-of select="/dataroot/user-params/owner-email"/>
</xsl:if>
<br/>
<xsl:call-template name="WriteDateRange">
<xsl:with-param name="szStart" select="$rgndLocfmts[@abs = $absStart]/@long"/>
<xsl:with-param name="szEnd" select="$rgndLocfmts[@abs = $absEnd]/@long"/>
</xsl:call-template>
<xsl:if test="/dataroot/env-params/tz-name">
<br/>
Tijdzone: <xsl:value-of select="/dataroot/env-params/tz-name"/>
</xsl:if>
<xsl:if test="/dataroot/env-params/observes-dst">
<br/>
(Aangepast aan zomertijd)
</xsl:if>
</font></td>
</tr>
</table>
<center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
</xsl:template>
<!-- **************************************************************************************************************
WriteSectionDatepick()
*************************************************************************************************************** -->
<xsl:template name="WriteSectionDatepick">
<!-- We need to form a new node set, so that the month positions don't get messed up by the year groupings -->
<xsl:variable name="rgndMonths" select="/dataroot/calendar/year/month"/>
<!-- We need a table to arrange the datepickers into two columns -->
<table xsl:use-attribute-sets="table-outer">
<xsl:for-each select="$rgndMonths">
<!-- Only write out at most $iMaxDatePick datepickers -->
<xsl:if test="(position() mod 2 = 1) and (position() < $iMaxDatePick)">
<tr>
<!-- If we have an odd number of datepickers, center the last one in its own row -->
<xsl:choose>
<xsl:when test="count(following::month[1]) > 0">
<td width="50%" valign="top"><xsl:apply-templates select="current()" mode="ModeDatepick"/></td>
<td width="50%" valign="top"><xsl:apply-templates select="following::month[1]" mode="ModeDatepick"/></td>
</xsl:when>
<xsl:otherwise>
<td colspan="2" valign="top"><xsl:apply-templates select="current()" mode="ModeDatepick"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:if>
</xsl:for-each>
</table>
<xsl:if test="count($rgndMonths) > $iMaxDatePick">
<xsl:variable name="absMonthStart" select="$rgndMonths[position() = count($rgndMonths)]/@start-abs"/>
<table xsl:use-attribute-sets="table-outer">
<tr>
<td align="center"><font xsl:use-attribute-sets="font-datepick-month"><b>
... tot <xsl:value-of select="$rgndLocfmts[@abs = $absMonthStart]/@month"/>
</b></font></td>
</tr>
<tr>
<td height="{$iLineHeight}"><img xsl:use-attribute-sets="img-line-datepick-ellipsis"/></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</xsl:if>
</xsl:template>
<!-- **************************************************************************************************************
WriteSectionLegend()
*************************************************************************************************************** -->
<xsl:template name="WriteSectionLegend">
<table xsl:use-attribute-sets="table-outer">
<tr>
<xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbBusy"/></xsl:call-template>
<xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbTent"/></xsl:call-template>
<xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbOof"/></xsl:call-template>
<xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbFree"/></xsl:call-template>
<xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbOowh"/></xsl:call-template>
</tr>
</table>
</xsl:template>
<!-- **************************************************************************************************************
WriteSectionSchedule()
*************************************************************************************************************** -->
<xsl:template name="WriteSectionSchedule">
<xsl:for-each select="/dataroot/calendar/year/month">
<!-- Month header -->
<table xsl:use-attribute-sets="table-outer">
<tr>
<td> </td>
</tr>
<tr>
<td xsl:use-attribute-sets="td-schedule-month"><font xsl:use-attribute-sets="font-schedule-month"><b>
<xsl:value-of select="$rgndLocfmts[@abs = current()/@start-abs]/@month"/>
</b></font></td>
</tr>
</table>
<center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
<xsl:for-each select="week/day">
<xsl:apply-templates select="current()" mode="ModeSchedule"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<!-- **************************************************************************************************************
WriteSectionEvents()
*************************************************************************************************************** -->
<xsl:template name="WriteSectionEvents">
<!-- Stick a separator at the top -->
<center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
<table xsl:use-attribute-sets="table-outer-padded">
<xsl:apply-templates select="/dataroot/calendar/year" mode="ModeEvents"/>
</table>
</xsl:template>
<!-- **************************************************************************************************************
WriteSectionOngoing()
*************************************************************************************************************** -->
<xsl:template name="WriteSectionOngoingAppts">
<xsl:variable name="rgndOngoingAppts" select="/dataroot/ongoing-appts/ongoing-ref"/>
<!-- Only write out an ongoing appts section if there are ongoing appts -->
<xsl:if test="count($rgndOngoingAppts) > 0">
<!-- Ongoing appts header -->
<table xsl:use-attribute-sets="table-outer">
<tr>
<td> </td>
</tr>
<tr>
<td xsl:use-attribute-sets="td-ongoing-head"><font xsl:use-attribute-sets="font-ongoing-head"><b>
Doorlopende afspraken
</b></font></td>
</tr>
</table>
<center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
<!-- Write out the data -->
<table xsl:use-attribute-sets="table-outer">
<!-- Group the ongoing appointments by recgroup -->
<xsl:for-each select="/dataroot/env-params/recgroup-data/recgroup">
<xsl:variable name="iRecGroup" select="@num"/>
<xsl:for-each select="$rgndOngoingAppts[@recgroup = $iRecGroup]">
<xsl:variable name="iApptId" select="@id"/>
<!-- Write out the row -->
<xsl:call-template name="WriteOngoingRow">
<xsl:with-param name="ndAppt" select="/dataroot/appointments/appt[@id = $iApptId]"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:if>
</xsl:template>
<!-- **************************************************************************************************************
WriteSectionDetails()
*************************************************************************************************************** -->
<xsl:template name="WriteSectionDetails">
<!-- Only write out a details section if there are appointments with details there -->
<xsl:if test="count($rgndDetailedAppts) > 0">
<!-- Details header -->
<table xsl:use-attribute-sets="table-outer">
<tr>
<td> </td>
</tr>
<tr>
<td xsl:use-attribute-sets="td-details-head"><font xsl:use-attribute-sets="font-details-head"><b>
Details
</b></font></td>
</tr>
</table>
<xsl:apply-templates select="$rgndDetailedAppts" mode="ModeDetails"/>
<center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
</xsl:if>
</xsl:template>
<!-- **************************************************************************************************************
WriteLegendCell()
*************************************************************************************************************** -->
<xsl:template name="WriteLegendCell">
<xsl:param name="efbNum"/>
<td width="{$iFbWidth}" height="{$iFbHeight}">
<xsl:call-template name="WriteFbImage">
<xsl:with-param name="efbNum" select="$efbNum"/>
</xsl:call-template>
</td>
<td align="{$szBidiAlignLeft}" valign="center" height="{$iFbHeight}"><font xsl:use-attribute-sets="font-legend">
<xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num=$efbNum]"/>
</font></td>
</xsl:template>
<!-- **************************************************************************************************************
WriteDatepickDowCell()
*************************************************************************************************************** -->
<xsl:template name="WriteDatepickDowCell">
<xsl:param name="iCol"/>
<td xsl:use-attribute-sets="td-datepick-dow"><font xsl:use-attribute-sets="font-datepick-dow">
<xsl:value-of select="/dataroot/env-params/dow-data/dow[@num=(/dataroot/env-params/first-dow + $iCol) mod 7]/@one-char"/>
</font></td>
</xsl:template>
<!-- **************************************************************************************************************
template<month>(ModeDatepick)
*************************************************************************************************************** -->
<xsl:template match="month" mode="ModeDatepick">
<!-- Get the column offset of the first day of month (adjust day of weeks) -->
<xsl:variable name="iDowAdjust" select="(@start-dow - /dataroot/env-params/first-dow + 7) mod 7"/>
<table xsl:use-attribute-sets="table-datepick">
<tr>
<td height="20" colspan="9" align="center"><font xsl:use-attribute-sets="font-datepick-month"><b>
<xsl:value-of select="$rgndLocfmts[@abs = current()/@start-abs]/@month"/>
</b></font></td>
</tr>
<tr>
<td xsl:use-attribute-sets="td-datepick-date-hmargin"> </td>
<xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="0"/></xsl:call-template>
<xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="1"/></xsl:call-template>
<xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="2"/></xsl:call-template>
<xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="3"/></xsl:call-template>
<xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="4"/></xsl:call-template>
<xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="5"/></xsl:call-template>
<xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="6"/></xsl:call-template>
<td xsl:use-attribute-sets="td-datepick-date-hmargin"> </td>
</tr>
<tr>
<td colspan="9" height="{$iLineHeight}"><img xsl:use-attribute-sets="img-line-datepick"/></td>
</tr>
<xsl:call-template name="WriteDatepickWeekAndRecurse">
<xsl:with-param name="iDayOfFirstCol" select="1 - $iDowAdjust"/>
</xsl:call-template>
<tr>
<td colspan="9"> </td>
</tr>
</table>
</xsl:template>
<!-- **************************************************************************************************************
WriteDatepickWeekAndRecurse
*************************************************************************************************************** -->
<xsl:template name="WriteDatepickWeekAndRecurse">
<xsl:param name="iDayOfFirstCol"/>
<xsl:if test="$iDayOfFirstCol <= @days">
<tr>
<td xsl:use-attribute-sets="td-datepick-date-hmargin"> </td>
<xsl:call-template name="WriteDatepickDayAndRecurse">
<xsl:with-param name="iDay" select="$iDayOfFirstCol"/>
<xsl:with-param name="iLastDay" select="$iDayOfFirstCol + 6"/>
</xsl:call-template>
<td xsl:use-attribute-sets="td-datepick-date-hmargin"> </td>
</tr>
<xsl:call-template name="WriteDatepickWeekAndRecurse">
<xsl:with-param name="iDayOfFirstCol" select="$iDayOfFirstCol + 7"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- **************************************************************************************************************
WriteDatepickDayAndRecurse
*************************************************************************************************************** -->
<xsl:template name="WriteDatepickDayAndRecurse">
<xsl:param name="iDay"/>
<xsl:param name="iLastDay"/>
<xsl:if test="$iDay <= $iLastDay">
<xsl:variable name="iDayAbs" select="$iDay - 1 + @start-abs"/>
<xsl:variable name="fInMonth" select="$iDay >= 1 and $iDay <= @days"/>
<xsl:variable name="ndDay" select=".//day[@abs=$iDayAbs]"/>
<xsl:variable name="fInRange" select="$fInMonth and boolean($ndDay)"/>
<xsl:variable name="fLink" select="$fInRange and (not($fEventsLayout) or boolean($ndDay/appt-ref[@first-ref]))"/>
<!-- O12:256349 When a day contains nothing but continuations of multi-day events, link to the last multi-day event. -->
<xsl:variable name="ndFirstRef" select="$ndDay/appt-ref[position() = last()]"/>
<xsl:variable name="fLinkAlt" select="$fLink or ($fInRange and boolean($ndFirstRef))"/>
<xsl:choose>
<xsl:when test="$fInRange">
<td xsl:use-attribute-sets="td-datepick-date-in">
<xsl:choose>
<xsl:when test="$fLink">
<a href="#day{$szRandomSeed}_{$iDayAbs}">
<font xsl:use-attribute-sets="font-datepick-date-in-link"><b><xsl:value-of select="$iDay"/></b></font>
</a>
</xsl:when>
<xsl:when test="$fLinkAlt">
<xsl:variable name="iDayAbsAlt" select="/dataroot/appointments/appt[@id = $ndFirstRef/@id]/start/@abs"/>
<a href="#day{$szRandomSeed}_{$iDayAbsAlt}">
<font xsl:use-attribute-sets="font-datepick-date-in-link"><b><xsl:value-of select="$iDay"/></b></font>
</a>
</xsl:when>
<xsl:otherwise>
<font xsl:use-attribute-sets="font-datepick-date-in-nolink"><b><xsl:value-of select="$iDay"/></b></font>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:when>
<xsl:otherwise>
<td xsl:use-attribute-sets="td-datepick-date-out">
<xsl:choose>
<xsl:when test="not($fInMonth)"> </xsl:when>
<xsl:otherwise>
<font xsl:use-attribute-sets="font-datepick-date-out"><xsl:value-of select="$iDay"/></font>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="WriteDatepickDayAndRecurse">
<xsl:with-param name="iDay" select="$iDay + 1"/>
<xsl:with-param name="iLastDay" select="$iLastDay"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- **************************************************************************************************************
template<day>(ModeSchedule)
*************************************************************************************************************** -->
<xsl:template match="day" mode="ModeSchedule">
<!-- Skip over runs of identical appointments (except the first appt of each run) -->
<xsl:if test="not(identical-days) or identical-days/@startabs = @abs">
<br/>
<!-- Day header -->
<table xsl:use-attribute-sets="table-outer-padded">
<tr>
<td width="{$iScheduleHMarginOuter}" align="center">
<a href="#top{$szRandomSeed}"><img xsl:use-attribute-sets="img-uparrow"/></a>
</td>
<td width="{$iOuterTableWidth - $iScheduleHMarginOuter}" colspan="4"><font xsl:use-attribute-sets="font-schedule-day"><b>
<xsl:choose>
<xsl:when test="not(identical-days)">
<!-- In the non-identical days case, we just have one date and one bookmark -->
<xsl:value-of select="$rgndLocfmts[@abs = current()/@abs]/@short"/>
<a name="day{$szRandomSeed}_{@abs}"> </a>
</xsl:when>
<xsl:otherwise>
<!-- In the identical days case, we have a range of dates, followed by a small number of bookmarks -->
<xsl:variable name="absStartIdent" select="identical-days/@startabs"/>
<xsl:variable name="absEndIdent" select="identical-days/@endabs"/>
<xsl:variable name="rgndDays" select="/dataroot/calendar/year/month/week/day"/>
<xsl:call-template name="WriteDateRange">
<xsl:with-param name="szStart" select="$rgndLocfmts[@abs = $absStartIdent]/@short"/>
<xsl:with-param name="szEnd" select="$rgndLocfmts[@abs = $absEndIdent]/@short"/>
</xsl:call-template>
<!-- Check out this super cool for-loop technique from http://lists.xml.org/archives/xml-dev/200203/msg00442.html -->
<xsl:for-each select="$rgndDays[position() <= $absEndIdent + 1 - $absStartIdent]">
<xsl:variable name="absCurIdent" select="position() - 1 + $absStartIdent"/>
<a name="day{$szRandomSeed}_{$absCurIdent}"> </a>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</b></font></td>
</tr>
</table>
<!-- Schedule grid -->
<table xsl:use-attribute-sets="table-outer-padded">
<xsl:apply-templates select="appt-ref[@allday]|free-block[@allday]" mode="ModeSchedule"/>
<xsl:apply-templates select="appt-ref[not(@allday)]|free-block[not(@allday)]" mode="ModeSchedule"/>
</table>
<!-- Terminating line -->
<center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
</xsl:if>
</xsl:template>
<!-- **************************************************************************************************************
template<day/appt-ref|day/free-block>(ModeSchedule)
*************************************************************************************************************** -->
<xsl:template match="appt-ref|free-block" mode="ModeSchedule">
<xsl:choose>
<xsl:when test="local-name(.) = 'appt-ref'">
<xsl:call-template name="WriteScheduleRow">
<xsl:with-param name="fApptRef" select="true()"/>
<xsl:with-param name="ndDay" select=".."/>
<xsl:with-param name="ndAppt" select="/dataroot/appointments/appt[@id = current()/@id]"/>
<xsl:with-param name="fAllday" select="boolean(@allday)"/>
<xsl:with-param name="fInWkgHrs" select="boolean(@wkghrs)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="WriteScheduleRow">
<xsl:with-param name="fApptRef" select="false()"/>
<xsl:with-param name="ndDay" select=".."/>
<xsl:with-param name="ndAppt" select="."/>
<xsl:with-param name="fAllday" select="boolean(@allday)"/>
<xsl:with-param name="fInWkgHrs" select="boolean(@wkghrs)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- **************************************************************************************************************
WriteScheduleRow()
*************************************************************************************************************** -->
<xsl:template name="WriteScheduleRow">
<xsl:param name="fApptRef"/>
<xsl:param name="ndDay"/>
<xsl:param name="ndAppt"/>
<xsl:param name="fAllday"/>
<xsl:param name="fInWkgHrs"/>
<!-- Adjust working hours to make allday appointments gray iff the day is not a workday -->
<xsl:variable name="szInWkgHrsAdjusted">
<xsl:choose>
<xsl:when test="not($fAllday)"><xsl:value-of select="boolean($fInWkgHrs)"/></xsl:when>
<xsl:otherwise><xsl:value-of select="boolean(/dataroot/env-params/dow-data/dow[@num = $ndDay/@dow]/@workday)"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Note the trickiness of booleans in XSL -->
<xsl:variable name="fInWkgHrsAdjusted" select="$szInWkgHrsAdjusted = 'true'"/>
<!-- Free busy defaults to free -->
<xsl:variable name="efbNum">
<xsl:choose>
<xsl:when test="$fApptRef"><xsl:value-of select="$ndAppt/fbstatus"/></xsl:when>
<xsl:when test="$fHidingOowh and not($fInWkgHrsAdjusted)"><xsl:value-of select="$efbOowh"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$efbFree"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- For the image only: "Free" gets converted to "Outside of Working Hours" when outside of working hours -->
<xsl:variable name="efbNumForImage">
<xsl:choose>
<xsl:when test="not($fInWkgHrsAdjusted) and $efbNum = $efbFree"><xsl:value-of select="$efbOowh"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$efbNum"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Pick the foreground color -->
<xsl:variable name="szFgColorSchedule">
<xsl:choose>
<xsl:when test="$efbNum = $efbOowh"><xsl:value-of select="$szFgColorScheduleOowh"/></xsl:when>
<xsl:when test="$efbNum = $efbBusy and $fAllday"><xsl:value-of select="$szFgColorScheduleAlldayBusy"/></xsl:when>
<xsl:when test="$efbNum = $efbOof and $fAllday"><xsl:value-of select="$szFgColorScheduleAlldayOof"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$szFgColorScheduleDefault"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Pick the background color -->
<xsl:variable name="szBgColorSchedule">
<xsl:choose>
<xsl:when test="$efbNum = $efbBusy and $fAllday"><xsl:value-of select="$szBgColorScheduleAlldayBusy"/></xsl:when>
<xsl:when test="$efbNum = $efbOof and $fAllday"><xsl:value-of select="$szBgColorScheduleAlldayOof"/></xsl:when>
<xsl:when test="not($fInWkgHrsAdjusted)"><xsl:value-of select="$szBgColorScheduleOowh"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$szBgColorScheduleDefault"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Some complex rules for expressing this time range -->
<xsl:variable name="szTime">
<xsl:choose>
<xsl:when test="$fAllday">
<!-- Case 0) If the appointment covers this entire day -->
<xsl:value-of select="$szAllDay"/>
</xsl:when>
<xsl:when test="($ndAppt/start/@abs < $ndDay/@abs)">
<!-- Case 1) This is the tail end of a multi-day appointment which ends at an off-time -->
<xsl:call-template name="WriteTimeRange">
<xsl:with-param name="szStart">
Begin van dag
</xsl:with-param>
<xsl:with-param name="szEnd" select="$ndAppt/end/@tmlocfmt"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="(substring($ndAppt/start/@local, 9, 4) = '0000')">
<!-- Case 2) This is a single-day appointment which starts at midnight and ends at an off-time -->
<xsl:choose>
<xsl:when test="substring($ndAppt/end/@local, 9, 4) = '0000'">
<!-- Interesting case when the start == end == midnight, and we don't want to say "Before 12:00 AM" -->
<xsl:call-template name="WriteTimeRange">
<xsl:with-param name="szStart" select="$ndAppt/end/@tmlocfmt"/>
<xsl:with-param name="szEnd" select="$ndAppt/end/@tmlocfmt"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
Voor <xsl:value-of select="$ndAppt/end/@tmlocfmt"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$ndAppt/end/@abs = $ndDay/@abs + 1 and substring($ndAppt/end/@local, 9, 4) = '0000'">
<!-- Case 3) This is a single-day appointment which starts at an off-time and ends at midnight -->
Na <xsl:value-of select="$ndAppt/start/@tmlocfmt"/>
</xsl:when>
<xsl:when test="$ndAppt/end/@abs > $ndDay/@abs">
<!-- Case 4) This is the front end of a multi-day appointment which starts at an off-time -->
<xsl:call-template name="WriteTimeRange">
<xsl:with-param name="szStart" select="$ndAppt/start/@tmlocfmt"/>
<xsl:with-param name="szEnd">
Einde van dag
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<!-- Case 5) This is a single-day appointment whcih starts and ends at off-times -->
<xsl:call-template name="WriteTimeRange">
<xsl:with-param name="szStart" select="$ndAppt/start/@tmlocfmt"/>
<xsl:with-param name="szEnd" select="$ndAppt/end/@tmlocfmt"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- If the subject isn't specified, default it to the free-busy status -->
<xsl:variable name="szSubject">
<xsl:choose>
<xsl:when test="$ndAppt/subject">
<xsl:value-of select="$ndAppt/subject"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num=$efbNum]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Decide wheter or not to bold the text -->
<xsl:variable name="fBold" select="not($fApptRef) and $efbNum = $efbFree"/>
<!-- Finally, we can render -->
<tr>
<td width="{$iScheduleHMarginOuter}"></td>
<td width="{$iFbWidth}" bgcolor="{$szBgColorSchedule}" valign="top">
<xsl:call-template name="WriteFbImage">
<xsl:with-param name="efbNum" select="$efbNumForImage"/>
</xsl:call-template>
</td>
<td width="{$iScheduleTimeWidth}" align="{$szBidiAlignRight}" valign="top" bgcolor="{$szBgColorSchedule}"><font xsl:use-attribute-sets="font-schedule-text" color="{$szFgColorSchedule}">
<xsl:choose>
<xsl:when test="$fBold"><b><xsl:value-of select="$szTime"/></b></xsl:when>
<xsl:otherwise><xsl:value-of select="$szTime"/></xsl:otherwise>
</xsl:choose>
</font></td>
<td width="{$iScheduleHMarginInner}" bgcolor="{$szBgColorSchedule}"></td>
<td width="{$iScheduleSubjectWidth}" valign="top" bgcolor="{$szBgColorSchedule}"><font xsl:use-attribute-sets="font-schedule-text" color="{$szFgColorSchedule}">
<xsl:choose>
<xsl:when test="$fBold"><b><xsl:value-of select="$szSubject"/></b></xsl:when>
<xsl:when test="$ndAppt/has-details"><a href="#appt{$szRandomSeed}_{@id}"><xsl:value-of select="$szSubject"/></a></xsl:when>
<xsl:otherwise><xsl:value-of select="$szSubject"/></xsl:otherwise>
</xsl:choose>
<xsl:if test="$ndAppt/location">
<br/>
<xsl:value-of select="$ndAppt/location"/>
</xsl:if>
<xsl:if test="$ndAppt/organizer/name">
<br/>
<xsl:value-of select="$ndAppt/organizer/name"/>
</xsl:if>
</font></td>
</tr>
</xsl:template>
<!-- **************************************************************************************************************
template<year>(ModeEvents)
*************************************************************************************************************** -->
<xsl:template match="year" mode="ModeEvents">
<!-- Select all the days in this year which have appointments starting on them
Jan 1 is special because all of the referenced appointments will be shown, even if they started
before Jan 1 -->
<xsl:variable name="rgndJan1" select="month/week/day[@num = 1 and ../../@num = 1 and boolean(appt-ref)]"/>
<xsl:variable name="rgndDays" select="$rgndJan1|month/week/day[boolean(appt-ref[@first-ref])]"/>
<xsl:variable name="iColSpan" select="6"/>
<!-- Year header (only if there is at least 2 years) -->
<xsl:if test="count(/dataroot/calendar/year) > 1">
<tr>
<td xsl:use-attribute-sets="td-events-year" colspan="{$iColSpan}"><font xsl:use-attribute-sets="font-events-year"><b>
<xsl:value-of select="@num"/>
</b></font></td>
</tr>
<!-- Match a year header with a "No Events" explanation, if applicable -->
<xsl:if test="count($rgndDays) = 0">
<tr><td colspan="{$iColSpan}"> </td></tr>
<tr>
<td colspan="{$iColSpan}"><font xsl:use-attribute-sets="font-events-disabled">
Geen gebeurtenissen
</font></td>
</tr>
<tr><td colspan="{$iColSpan}"> </td></tr>
</xsl:if>
</xsl:if>
<!-- All of the year's data goes in one table -->
<xsl:for-each select="$rgndDays">
<!-- Day separator (but not for the first day) -->
<xsl:if test="position() > 1">
<tr>
<td height="{$iLineHeight}" align="center" colspan="{$iColSpan}">
<img xsl:use-attribute-sets="img-line-event-separator"/>
</td>
</tr>
</xsl:if>
<!-- Write the events for the day -->
<xsl:apply-templates select="current()" mode="ModeEvents"/>
</xsl:for-each>
<!-- Stick a separator at the bottom of each year -->
<tr>
<td height="{$iLineHeight}" colspan="{$iColSpan}"><img xsl:use-attribute-sets="img-line-outer-thin"/></td>
</tr>
</xsl:template>
<!-- **************************************************************************************************************
template<day>(ModeEvents)
*************************************************************************************************************** -->
<xsl:template match="day" mode="ModeEvents">
<xsl:variable name="absDay" select="@abs"/>
<xsl:variable name="ndDay" select="/dataroot/calendar/year/month/week/day[@abs = $absDay]"/>
<xsl:variable name="iYear" select="$ndDay/../../../@num"/>
<!-- Select the appointments we need to write out -->
<xsl:variable name="fJan1" select="@num = 1 and ../../@num = 1"/>
<xsl:variable name="rgndApptRefs" select="appt-ref[$fJan1]|appt-ref[@first-ref]"/>
<xsl:variable name="rgndApptRefsAllDay" select="$rgndApptRefs[@allday]"/>
<xsl:variable name="rgndApptRefsNotAllDay" select="$rgndApptRefs[not(@allday)]"/>
<xsl:variable name="cndAllDay" select="count($rgndApptRefs[@allday])"/>
<!-- Write out the all day events on this day -->
<xsl:for-each select="$rgndApptRefsAllDay">
<xsl:variable name="iId" select="./@id"/>
<xsl:call-template name="WriteEventRow">
<xsl:with-param name="ndAppt" select="/dataroot/appointments/appt[@id = $iId]"/>
<xsl:with-param name="fForceStartDay" select="false()"/>
<xsl:with-param name="fFirstRow" select="position() = 1"/>
<xsl:with-param name="iYear" select="$iYear"/>
</xsl:call-template>
</xsl:for-each>
<!-- Write out the non-all day events on this day -->
<xsl:for-each select="$rgndApptRefsNotAllDay">
<xsl:variable name="iId" select="./@id"/>
<xsl:variable name="ndAppt" select="/dataroot/appointments/appt[@id = $iId]"/>
<xsl:call-template name="WriteEventRow">
<xsl:with-param name="ndAppt" select="/dataroot/appointments/appt[@id = $iId]"/>
<xsl:with-param name="fForceStartDay" select="position() = 1"/>
<xsl:with-param name="fFirstRow" select="position() = 1 and count($rgndApptRefsAllDay) = 0"/>
<xsl:with-param name="iYear" select="$iYear"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- **************************************************************************************************************
WriteEventRow()
*************************************************************************************************************** -->
<xsl:template name="WriteEventRow">
<xsl:param name="ndAppt"/>
<xsl:param name="fForceStartDay"/>
<xsl:param name="fFirstRow"/>
<xsl:param name="iYear"/>
<!-- If the subject isn't specified, default it to the free-busy status -->
<xsl:variable name="szSubject">
<xsl:choose>
<xsl:when test="$ndAppt/subject">
<xsl:value-of select="$ndAppt/subject"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num = $ndAppt/fbstatus]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Figure out the time fields -->
<xsl:variable name="f12to12" select="substring($ndAppt/start/@local, 9, 4) = '0000' and substring($ndAppt/end/@local, 9, 4) = '0000'"/>
<xsl:variable name="iDaySpan" select="$ndAppt/end/@abs - $ndAppt/start/@abs + 1 - boolean($f12to12)"/>
<xsl:variable name="absStart" select="$ndAppt/start/@abs"/>
<xsl:variable name="absEnd" select="$ndAppt/end/@abs - boolean($f12to12)"/>
<xsl:variable name="szStartDate">
<xsl:if test="$iDaySpan > 1 or ($iDaySpan = 1 and $f12to12) or $fForceStartDay">
<xsl:variable name="iStartYear" select="number(substring($ndAppt/start/@local, 1, 4))"/>
<xsl:choose>
<xsl:when test="$iStartYear = $iYear">
<xsl:value-of select="$rgndLocfmts[@abs = $absStart]/@short"/>
</xsl:when>
<xsl:otherwise>
(<xsl:value-of select="$rgndLocfmts[@abs = $absStart]/@short-withyear"/>)
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:variable name="szTo">
<xsl:if test="$iDaySpan > 1">
t/m
</xsl:if>
</xsl:variable>
<xsl:variable name="szEndDate">
<xsl:variable name="iEndYear" select="number(substring($ndAppt/end/@local, 1, 4))"/>
<xsl:if test="$iDaySpan > 1">
<xsl:choose>
<xsl:when test="$iEndYear = $iYear">
<xsl:value-of select="$rgndLocfmts[@abs = $absEnd]/@short"/>
</xsl:when>
<xsl:otherwise>
(<xsl:value-of select="$rgndLocfmts[@abs = $absEnd]/@short-withyear"/>)
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:variable name="szTimeRange">
<xsl:if test="not($f12to12)">
<xsl:call-template name="WriteTimeRange">
<xsl:with-param name="szStart" select="$ndAppt/start/@tmlocfmt"/>
<xsl:with-param name="szEnd" select="$ndAppt/end/@tmlocfmt"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<!-- Finally, write out the row -->
<tr>
<td width="{$iEventHMarginOuter + $iUpArrowWidth}" valign="top">
<!-- Write out a bookmark for the day pointing to the first event -->
<xsl:choose>
<xsl:when test="$fFirstRow">
<a name="day{$szRandomSeed}_{$absStart}"> </a><a href="#top{$szRandomSeed}"><img xsl:use-attribute-sets="img-uparrow"/></a>
</xsl:when>
<xsl:otherwise> </xsl:otherwise>
</xsl:choose>
</td>
<td xsl:use-attribute-sets="td-events-subject"><font xsl:use-attribute-sets="font-events-text">
<!-- Subject & location cell -->
<xsl:choose>
<xsl:when test="$ndAppt/has-details">
<a href="#appt{$szRandomSeed}_{@id}"><b><xsl:value-of select="$szSubject"/></b></a>
</xsl:when>
<xsl:otherwise><b><xsl:value-of select="$szSubject"/></b></xsl:otherwise>
</xsl:choose>
<xsl:if test="$ndAppt/location">
<br/><xsl:value-of select="$ndAppt/location"/>
</xsl:if>
</font></td>
<td xsl:use-attribute-sets="td-events-time" nowrap=""><font xsl:use-attribute-sets="font-events-text"><xsl:value-of select="$szStartDate"/></font></td>
<td xsl:use-attribute-sets="td-events-time" nowrap=""><font xsl:use-attribute-sets="font-events-text"><xsl:value-of select="$szTo"/></font></td>
<td xsl:use-attribute-sets="td-events-time" nowrap=""><font xsl:use-attribute-sets="font-events-text"><xsl:value-of select="$szEndDate"/></font></td>
<td xsl:use-attribute-sets="td-events-time" nowrap=""><font xsl:use-attribute-sets="font-events-text"><xsl:value-of select="$szTimeRange"/></font></td>
</tr>
</xsl:template>
<!-- **************************************************************************************************************
WriteOngoingRow()
*************************************************************************************************************** -->
<xsl:template name="WriteOngoingRow">
<xsl:param name="ndAppt"/>
<!-- If the subject isn't specified, default it to the free-busy status -->
<xsl:variable name="szSubject">
<xsl:choose>
<xsl:when test="$ndAppt/subject">
<xsl:value-of select="$ndAppt/subject"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num=$ndAppt/fbstatus]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Write the row -->
<tr>
<td width="{$iOngoingHMarginOuter}" valign="top"> </td>
<td xsl:use-attribute-sets="td-ongoing-subject"><font xsl:use-attribute-sets="font-ongoing-text">
<xsl:choose>
<xsl:when test="$ndAppt/has-details">
<a href="#appt{$szRandomSeed}_{@id}"><b><xsl:value-of select="$szSubject"/></b></a>
</xsl:when>
<xsl:otherwise><b><xsl:value-of select="$szSubject"/></b></xsl:otherwise>
</xsl:choose>
<br/>
</font></td>
<td xsl:use-attribute-sets="td-ongoing-recurrence" valign="top"><font xsl:use-attribute-sets="font-ongoing-text">
<xsl:value-of select="$ndAppt/recurrence"/>
<br/>
</font></td>
<td width="{$iOngoingHMarginOuter}"> </td>
</tr>
<tr><td height="8" colspan="4"></td></tr>
</xsl:template>
<!-- **************************************************************************************************************
template<appointments/appt>(ModeDetails)
*************************************************************************************************************** -->
<xsl:template match="appt" mode="ModeDetails">
<xsl:variable name="absStart" select="start/@abs"/>
<center><a name="appt{$szRandomSeed}_{@id}"><img xsl:use-attribute-sets="img-line-outer-thin"/></a></center>
<!-- Only show the date header for the first detailed appointment of the day -->
<xsl:variable name="rgndDetailedApptsToday" select="$rgndDetailedAppts[start/@abs = $absStart]"/>
<xsl:if test="$rgndDetailedApptsToday[position() = 1]/@id = @id">
<table xsl:use-attribute-sets="table-outer">
<tr>
<td><font xsl:use-attribute-sets="font-details-day">
<b><xsl:value-of select="$rgndLocfmts[@abs = $absStart]/@long"/></b>
</font></td>
</tr>
</table>
</xsl:if>
<table xsl:use-attribute-sets="table-outer">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"><a href="#day{$szRandomSeed}_{$absStart}"><img xsl:use-attribute-sets="img-uparrow"/></a></td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Tijd
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<!-- Differentiate date/time format if appointment is multi-day -->
<xsl:choose>
<xsl:when test="start/@abs + 1 = end/@abs and substring(start/@local, 9, 4) = '0000' and substring(end/@local, 9, 4) = '0000'">
<xsl:value-of select="$szAllDay"/>
</xsl:when>
<xsl:when test="start/@abs = end/@abs">
<xsl:call-template name="WriteTimeRange">
<xsl:with-param name="szStart" select="start/@tmlocfmt"/>
<xsl:with-param name="szEnd" select="end/@tmlocfmt"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="WriteTimeRange">
<xsl:with-param name="szStart" select="start/@dtlocfmt"/>
<xsl:with-param name="szEnd" select="end/@dtlocfmt"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</font></td>
</tr>
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Onderwerp
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:choose>
<xsl:when test="subject"><xsl:value-of select="subject"/></xsl:when>
<xsl:otherwise>
(Geen onderwerp)
</xsl:otherwise>
</xsl:choose>
</font></td>
</tr>
<xsl:if test="location">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Locatie
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="location"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="recurrence">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Terugkeerpatroon
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="recurrence"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="importance and importance != '1'">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Urgentie
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="/dataroot/env-params/importance-data/importance[@num=current()/importance]"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="attachment">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Bijlagen
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:for-each select="attachment">
<xsl:value-of select="."/><br/>
</xsl:for-each>
</font></td>
</tr>
</xsl:if>
<xsl:if test="reminder">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Herinnering
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="reminder"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="fbstatus and not($fEventsLayout)">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Tijd weergeven als
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num=current()/fbstatus]"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="conftype">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"> </td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
Dit is een onlinevergadering met <xsl:value-of select="/dataroot/env-params/conftype-data/conftype[@num=current()/conftype]"/>
<br/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="body">
<xsl:variable name="szBodyLtrOrRtl">
<xsl:choose>
<xsl:when test="boolean(body/@rtl-strong)">rtl</xsl:when>
<xsl:otherwise>ltr</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"> </td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value-noalign" dir="{$szBodyLtrOrRtl}"><font xsl:use-attribute-sets="font-details-text">
<xsl:copy-of select="body/child::node()|body/child::text()"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="contacts">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Contactpersonen
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="contacts"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="categories">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Categorieën
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="categories"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="sensitivity and sensitivity != '0'">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Gevoeligheid
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="/dataroot/env-params/sensitivity-data/sensitivity[@num=current()/sensitivity]"/>
</font></td>
</tr>
</xsl:if>
<xsl:if test="organizer|attendee">
<tr>
<td xsl:use-attribute-sets="td-details-leftmargin"> </td>
<td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
Deelnemers
</b></font></td>
<td xsl:use-attribute-sets="td-details-innermargin"> </td>
<td xsl:use-attribute-sets="td-details-value">
<table width="100%">
<tr>
<td nowrap=""><font xsl:use-attribute-sets="font-details-text"><b>
Naam <E-mail>
</b></font></td>
<td nowrap=""><font xsl:use-attribute-sets="font-details-text"><b>
Aanwezigheid
</b></font></td>
</tr>
<xsl:apply-templates select="organizer" mode="ModeDetails"/>
<xsl:apply-templates select="attendee" mode="ModeDetails"/>
</table>
</td>
</tr>
</xsl:if>
</table>
</xsl:template>
<!-- **************************************************************************************************************
template<organizer|attendee>(ModeDetails)
*************************************************************************************************************** -->
<xsl:template match="organizer|attendee" mode="ModeDetails">
<tr>
<td valign="top"><font xsl:use-attribute-sets="font-details-text">
<xsl:choose>
<xsl:when test="boolean(email)">
<xsl:value-of select="name"/> <<xsl:value-of select="email"/>>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name"/>
</xsl:otherwise>
</xsl:choose>
<br/>
</font></td>
<td valign="top" nowrap=""><font xsl:use-attribute-sets="font-details-text">
<xsl:value-of select="/dataroot/env-params/attendeetype-data/attendeetype[@num = current()/@type]"/>
<br/>
</font></td>
</tr>
</xsl:template>
<!-- **************************************************************************************************************
WriteFbImage()
*************************************************************************************************************** -->
<xsl:template name="WriteFbImage">
<xsl:param name="efbNum"/>
<xsl:variable name="srcShort">
<xsl:choose>
<xsl:when test="$efbNum = $efbFree">free</xsl:when>
<xsl:when test="$efbNum = $efbTent">tent</xsl:when>
<xsl:when test="$efbNum = $efbBusy">busy</xsl:when>
<xsl:when test="$efbNum = $efbOof">oof</xsl:when>
<xsl:when test="$efbNum = $efbOowh">oowh</xsl:when>
</xsl:choose>
</xsl:variable>
<img width="{$iFbWidth}" height="{$iFbHeight}">
<xsl:attribute name="src"><xsl:value-of select="concat('cid:paycal_', $srcShort, '.gif')"/></xsl:attribute>
</img>
</xsl:template>
<!-- **************************************************************************************************************
WriteTimeRange()
*************************************************************************************************************** -->
<xsl:template name="WriteTimeRange">
<xsl:param name="szStart"/>
<xsl:param name="szEnd"/>
<xsl:choose>
<xsl:when test="$szStart = $szEnd">
Om <xsl:value-of select="$szStart"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$szStart"/> – <xsl:value-of select="$szEnd"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- **************************************************************************************************************
WriteDateRange()
*************************************************************************************************************** -->
<xsl:template name="WriteDateRange">
<xsl:param name="szStart"/>
<xsl:param name="szEnd"/>
<xsl:choose>
<xsl:when test="$szStart = $szEnd">
Op <xsl:value-of select="$szStart"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$szStart"/> – <xsl:value-of select="$szEnd"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- **************************************************************************************************************
WriteUnboldedHtml()
*************************************************************************************************************** -->
<xsl:template name="WriteUnboldedHtml">
<xsl:param name="ndBody"/>
<!-- Iterate over each child -->
<xsl:for-each select="$ndBody/child::node()|$ndBody/child::text()">
<xsl:choose>
<!-- Recursively strip <b> tags -->
<xsl:when test="local-name(.) = 'b'">
<xsl:call-template name="WriteUnboldedHtml">
<xsl:with-param name="ndBody" select="."/>
</xsl:call-template>
</xsl:when>
<!-- Everything else comes in literally -->
<xsl:otherwise>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:call-template name="WriteUnboldedHtml">
<xsl:with-param name="ndBody" select="."/>
</xsl:call-template>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>